package com.amita.ez;

import org.teasoft.bee.osql.BeeException;
import org.teasoft.honey.osql.autogen.GenBean;
import org.teasoft.honey.osql.autogen.GenConfig;
import org.teasoft.honey.osql.core.HoneyConfig;

public class CodeIt {

    public static void main(String[] args) {
        try{

            String root = "/Users/daniellu/Desktop/ez/src/main/java/";
            String dbName= HoneyConfig.getHoneyConfig().getDbName();
//			driverName,url,username,password config in bee.properties.

            GenConfig config = new GenConfig();
            config.setDbName(dbName);
            config.setGenToString(true);//生成toString方法
            config.setGenSerializable(true);

//			更改成本地的具体路径  change to your real path
//			config.setBaseDir("D:\\xxx\\yyy\\bee-exam\\src\\main\\java\\");
            config.setBaseDir(root);
            config.setPackagePath("com.amita.ez.entity");
//			config.setPackagePath("org.teasoft.exam.bee.osql.entity.dynamic");
//			config.setPackagePath("org.teasoft.exam.bee.osql.entity.sqlite");
//			config.setPackagePath("org.teasoft.exam.bee.osql.entity.postgreSQL");
//			config.setPackagePath("org.teasoft.exam.bee.osql.entity.h2");

            GenBean genBean = new GenBean(config);
//			genBean.genSomeBeanFile("leaf_alloc,Orders");
//			genBean.genSomeBeanFile("Orders,user");
//			genBean.genSomeBeanFile("POSTGRESQL_TYPE");
//			genBean.genSomeBeanFile("H2_TYPE");

//            genBean.genSomeBeanFile("dma_east_zhxxb");
//			genBean.genSomeBeanFile("tableinfo");
//			genBean.genSomeBeanFile("leftsz_info");
//			genBean.genSomeBeanFile("t_test");
            genBean.genAllBeanFile();
//
        } catch (BeeException e) {
            e.printStackTrace();
        }

    }
}
